import '../styles/appleItem.scss'
import appleImg from '../images/apple.png'
function AppleItem({ title, weight, eatFn }) {
  return (
    <div className="appleItem">
      <img className="apple" alt="苹果" src={appleImg} />
      <div className="info">
        <div className="name">{title}</div>
        <div className="weight">{weight}克</div>
      </div>
      <div className="btn-div">
        <button onClick={eatFn}>吃掉</button>
      </div>
    </div>
  );
}

export default AppleItem;
